# -*- coding: utf-8 -*-

# Copyright (C) 2010 David Byers <david.byers@liu.se>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

from PyQt4.QtCore import *
from PyQt4.QtGui import *
from PyKDE4.kio import *
from PyKDE4.kdeui import *
from PyKDE4.kdecore import *

from mpdconfig_ui import Ui_Form as MPD_Ui_Form

class MPDConfig(QWidget, MPD_Ui_Form):
    def __init__(self, parent, settings):
        QWidget.__init__(self)
        self.setupUi(self)
        self.parent = parent

        self.port.setValue(settings["port"])
        self.server.setText(settings["server"])
        self.password.setText(settings["password"])

    def exportSettings(self):
        settings = {}
        settings["port"] = int(self.port.value())
        settings["server"] = str(self.server.text())
        settings["password"] = str(self.password.text())
        return settings

